package cn.JunitTest;
import cn.impl.UserDAOImpl;
import cn.model.VUserRole;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class UserDAOImplTest {
    /**
     * 构造方法重载基类的ForumContentDAOImpl()
     */
    UserDAOImpl udao = null;
    @Before
    public void init()
    {
        udao = new UserDAOImpl();
    }
    @Before
    public void setUp() throws Exception {
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void addUser() {
    }

    @Test
    public void deleteUser() {
    }

    @Test
    public void modifyUser() {
    }

    @Test
    public void getUserList() {
        System.out.println(udao.getUserList("xiaoming",1,10));
    }

    @Test
    public void getUserAmount() {
    }

    @Test
    public void upedtpwd() {
    }

    @Test
    public void getUserById() {
    }

    @Test
    public void queryUserById() {
    }

    @Test
    public void getVUserRoleById() {
        VUserRole vuserrole = udao.getVUserRoleById("xiaoming");
        System.out.println(vuserrole.getUsername());
    }

    @Test
    public void userLogin() {
        List<VUserRole> list = udao.userLogin("xiaoming","66f7070d15d68474e20219916d770fd5");
        System.out.println(list.get(0).getUserid());// new Date()为获取当前系统时间
    }

}